package pl.edu.pk.mech.kkbus.controller;

import java.util.List;
import java.util.logging.Logger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import pl.edu.pk.mech.kkbus.model.Refueling;
import pl.edu.pk.mech.kkbus.service.RefuelingService;

@Controller
public class RefuelingController extends RestController {

    @Autowired
    RefuelingService refuelingService;
	
    private static final Logger log = Logger.getLogger(DefectController.class.getName());
    
    @RequestMapping(value = "/refueling/{id}", method = RequestMethod.GET)
    public @ResponseBody List<Refueling> getDefect(@PathVariable String id) {
        log.info("Get refueling for bus" + id);
        return refuelingService.getRefuelingsByIdBus(id);
    }
}
